﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;

namespace netcoreweb
{
    public class Program
    {
        public static void Main(string[] args)
        {
            CreateHost(args).Build().Run();
        }

        public static IHostBuilder CreateHost(string[] args)
        {
            return Host.CreateDefaultBuilder(args)
                // .ConfigureLogging(logging =>
                // {
                //     logging.ClearProviders();
                //     logging.AddConsole();
                // })
                .ConfigureWebHostDefaults(webBuilder =>
                {
                    //使用.UseKestrel时，在vs中使用iis express调试时，必须配置为为进程外。否则就不能使用UseKestrel模式。
                    webBuilder.UseStartup<Startup>();
                    //.UseUrls("http://*:5000;https://*:5001");
                });
        }
    }
}
